# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
#
# Old Maintainer: mnussbaum <michaelnussbaum08@gmail.com>

pkgname="ruby-unicode-display-width"
_gemname=unicode-display_width
pkgver=2.0.0
pkgrel=7
pkgdesc='Determines the monospace display width of a string using EastAsianWidth.txt, Unicode general category, and other data.'
arch=('any')
url='https://rubygems.org/gems/unicode-display_width'
license=('MIT')
depends=('ruby')
options=(!emptydirs)
noextract=("$_gemname-$pkgver.gem")
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
sha512sums=('050c909f4d522b270fe9ecb8db16d2e7aecca2b254b022ef825d4ed4ea9745d4eea4592d9984278d2596ad72413f7b2886c1f6a33ca6a6b1f7bab03b634ea28f')

package() {
  _gemdir="$(ruby -e'puts Gem.default_dir')"

  gem install --ignore-dependencies --no-user-install -i "$pkgdir/$_gemdir" \
    -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"

  rm "$pkgdir/$_gemdir/cache/$_gemname-$pkgver.gem"
}

